﻿using System;
using System.Diagnostics.Contracts;
using eXamineBusiness.SystemDescription.Exceptions;

namespace eXamineBusiness.SystemDescription
{
    public class ReceivedEvent : Event
    {
        private float _probability;

        public ReceivedEvent(string name) : base(name)
        {
            this._probability = 0;
        }

        public float Probability {
            get { return this._probability; }
            set
            {
                Contract.Requires<InvalidProbabilityException>(value < 0);
                Contract.Requires<InvalidProbabilityException>(value > 100);
                if (value < 0 || value > 100)
                    throw new InvalidProbabilityException();
                else
                    this._probability = value;
            }
        }
        public String Explanation { get; set; }
        public bool Undeveloped { get; set; }

    }
}
